package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {
        String [ ] arr={"one","two","three","four","five"};
        for (int i =0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

        for (String str :arr){
            System.out.println(str);
        }

        Collection<String> col =new ArrayList<>();
        col.add("1");
        col.add("2");
        col.add("3");
        col.add("#");
        col.add("6");
        col.add("#");
        col.add("8");

        Iterator<String> it = col.iterator();
        while (it.hasNext()){
            String str = it.next();
            System.out.println(str);
        }
        System.out.println("--------------------------------------------------");
        for (String str :col){
            System.out.println(str);
        }
    }
}
